package com.hebeu.gfh.service.impl;

import com.hebeu.gfh.mapper.CollegeMapper;
import com.hebeu.gfh.pojo.po.College;
import com.hebeu.gfh.pojo.po.User;
import com.hebeu.gfh.service.collegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 刘剑利
 * @Version: v1.0
 */
@Service("collegeService")
public class collegeServiceImpl implements collegeService {
    @Autowired
    CollegeMapper collegeMapper;

    @Override
    public List<College> findAllCollege() {
        List<College> collegeList = collegeMapper.findAllCollege();
        return collegeList;
    }

    @Override
    public void addCollege(College college) {
        collegeMapper.addCollege(college);
    }

    @Override
    public void deleteCollege(int collegeId) {
        collegeMapper.deleteCollege(collegeId);
    }

    @Override
    public void updateCollege(College college) {
        collegeMapper.updateCollege(college);
    }

    @Override
    public College findCollegeById(int collegeId) {
        College college = collegeMapper.findCollegeById(collegeId);
        return college;
    }

    @Override
    public List<User> CollegeMember(int collegeId) {
        List<User> userList = collegeMapper.CollegeMember(collegeId);
        return userList;
    }
}
